package com.lindroid.entity

import com.fasterxml.jackson.annotation.JsonFormat
import com.fasterxml.jackson.annotation.JsonIgnore
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import com.fasterxml.jackson.annotation.JsonInclude
import java.util.*

/**
 * @JsonIgnore：生成json时不包含该字段
 * @JsonIgnoreProperties：生成json时不包含的字段集合，注解在类上
 * @JsonFormat：格式化时间
 * @JsonInclude：指定返回该字段的条件
 */
//@JsonIgnoreProperties(value = ["name"])
data class User(
    val name: String="",
    @JsonIgnore val password: String="",
    val age: Int,
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss a", locale = "zh", timezone = "GMT+8")  val birthday: Date,
    @JsonInclude(JsonInclude.Include.NON_EMPTY) val desc: String=""
)